From: Claudio Cambra Date: Fri, 28 Feb 2025 07:57:26 +0000 (+0800) Subject: gui/tray: Remove unused thumbnailjob class X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~15^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=476c2da02d9a37a1a07d1b2f80f74cf6341779b4;p=nextcloud-desktop.git gui/tray: Remove unused thumbnailjob class Signed-off-by: Claudio Cambra --- diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index d99986850..2bfa004dd 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -148,8 +148,6 @@ set(client_SRCS systray.h systray.cpp EncryptionTokenSelectionWindow.qml - thumbnailjob.h - thumbnailjob.cpp userinfo.h userinfo.cpp vfsdownloaderrordialog.h diff --git a/src/gui/thumbnailjob.cpp b/src/gui/thumbnailjob.cpp deleted file mode 100644 index 81d631289..000000000 --- a/src/gui/thumbnailjob.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) by Roeland Jago Douma - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#include "thumbnailjob.h" -#include "networkjobs.h" -#include "account.h" - -namespace OCC { - -ThumbnailJob::ThumbnailJob(const QString &path, AccountPtr account, QObject *parent) - : AbstractNetworkJob(account, QLatin1String("index.php/apps/files/api/v1/thumbnail/150/150/") + path, parent) -{ - setIgnoreCredentialFailure(true); -} - -void ThumbnailJob::start() -{ - sendRequest("GET", makeAccountUrl(path())); - AbstractNetworkJob::start(); -} - -bool ThumbnailJob::finished() -{ - emit jobFinished(reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), reply()->readAll()); - return true; -} -} diff --git a/src/gui/thumbnailjob.h b/src/gui/thumbnailjob.h deleted file mode 100644 index aa4fe6295..000000000 --- a/src/gui/thumbnailjob.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) by Roeland Jago Douma - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#ifndef THUMBNAILJOB_H -#define THUMBNAILJOB_H - -#include "networkjobs.h" -#include "accountfwd.h" - -namespace OCC { - -/** - * @brief Job to fetch a thumbnail for a file - * @ingroup gui - * - * Job that allows fetching a preview (of 150x150 for now) of a given file. - * Once the job has finished the jobFinished signal will be emitted. - */ -class ThumbnailJob : public AbstractNetworkJob -{ - Q_OBJECT -public: - explicit ThumbnailJob(const QString &path, AccountPtr account, QObject *parent = nullptr); -public slots: - void start() override; -signals: - /** - * @param statusCode the HTTP status code - * @param reply the content of the reply - * - * Signal that the job is done. If the statusCode is 200 (success) reply - * will contain the image data in PNG. If the status code is different the content - * of reply is undefined. - */ - void jobFinished(int statusCode, QByteArray reply); -private slots: - bool finished() override; -}; -} - -#endif // THUMBNAILJOB_H diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index e6ccd45e6..65229590b 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -18,7 +18,6 @@ #include "tray/unifiedsearchresultslistmodel.h" #include "tray/talkreply.h" #include "userstatusconnector.h" -#include "thumbnailjob.h" #include #include